package com.dragon.modules.yuegou.query.order;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.order.OrderCouponEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;

/**
 * 订单优惠 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-04-29 10:04:20
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class OrderCouponQuery extends OrderCouponEntity implements Query<OrderCouponEntity> {

    /** 订单优惠券ID查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 订单号查询条件 */
	@JsonUnwrapped(prefix = "orderNo")
	private Condition<String> orderNoCondition;

    /** 优惠金额查询条件 */
	@JsonUnwrapped(prefix = "amount")
	private Condition<BigDecimal> amountCondition;

    /** 会员优惠券ID查询条件 */
	@JsonUnwrapped(prefix = "couponId")
	private Condition<String> couponIdCondition;

    /** 优惠券名称查询条件 */
	@JsonUnwrapped(prefix = "couponName")
	private Condition<String> couponNameCondition;

    /** 优惠券模板ID(冗余ID)查询条件 */
	@JsonUnwrapped(prefix = "couponTemplateId")
	private Condition<String> couponTemplateIdCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public OrderCouponQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public OrderCouponQuery(OrderCouponEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public OrderCouponQuery(OrderCouponQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.orderNoCondition != null) {
			this.orderNoCondition = other.orderNoCondition.copy();
		}
		if(other.amountCondition != null) {
			this.amountCondition = other.amountCondition.copy();
		}
		if(other.couponIdCondition != null) {
			this.couponIdCondition = other.couponIdCondition.copy();
		}
		if(other.couponNameCondition != null) {
			this.couponNameCondition = other.couponNameCondition.copy();
		}
		if(other.couponTemplateIdCondition != null) {
			this.couponTemplateIdCondition = other.couponTemplateIdCondition.copy();
		}
	}

	@Override
	public QueryWrapper<OrderCouponEntity> toQueryWrapper() {
		QueryWrapper<OrderCouponEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (orderNoCondition != null) {
			orderNoCondition.toWrapper(wrapper, COL_ORDER_NO);
		}
		if (amountCondition != null) {
			amountCondition.toWrapper(wrapper, COL_AMOUNT);
		}
		if (couponIdCondition != null) {
			couponIdCondition.toWrapper(wrapper, COL_COUPON_ID);
		}
		if (couponNameCondition != null) {
			couponNameCondition.toWrapper(wrapper, COL_COUPON_NAME);
		}
		if (couponTemplateIdCondition != null) {
			couponTemplateIdCondition.toWrapper(wrapper, COL_COUPON_TEMPLATE_ID);
		}
		return wrapper;
	}
	
	/**
	 * 构造并返回订单优惠券ID查询条件
	 * 
	 * @return idCondition 订单优惠券ID查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取订单优惠券ID查询条件
	 * 
	 * @return idCondition 订单优惠券ID查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置订单优惠券ID查询条件
	 * 
	 * @param idCondition 订单优惠券ID查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回订单号查询条件
	 * 
	 * @return orderNoCondition 订单号查询条件
	 */
	public Condition<String> orderNo() {
		this.orderNoCondition = new Condition<>();
		return this.orderNoCondition;
	}
	
	/**
	 * 获取订单号查询条件
	 * 
	 * @return orderNoCondition 订单号查询条件
	 */
	public Condition<String> getOrderNoCondition() {
		return orderNoCondition;
	}

	/**
	 * 设置订单号查询条件
	 * 
	 * @param orderNoCondition 订单号查询条件
	 */
	public void setOrderNoCondition(Condition<String> orderNoCondition) {
		this.orderNoCondition = orderNoCondition;
	}

	/**
	 * 构造并返回优惠金额查询条件
	 * 
	 * @return amountCondition 优惠金额查询条件
	 */
	public Condition<BigDecimal> amount() {
		this.amountCondition = new Condition<>();
		return this.amountCondition;
	}
	
	/**
	 * 获取优惠金额查询条件
	 * 
	 * @return amountCondition 优惠金额查询条件
	 */
	public Condition<BigDecimal> getAmountCondition() {
		return amountCondition;
	}

	/**
	 * 设置优惠金额查询条件
	 * 
	 * @param amountCondition 优惠金额查询条件
	 */
	public void setAmountCondition(Condition<BigDecimal> amountCondition) {
		this.amountCondition = amountCondition;
	}

	/**
	 * 构造并返回会员优惠券ID查询条件
	 * 
	 * @return couponIdCondition 会员优惠券ID查询条件
	 */
	public Condition<String> couponId() {
		this.couponIdCondition = new Condition<>();
		return this.couponIdCondition;
	}
	
	/**
	 * 获取会员优惠券ID查询条件
	 * 
	 * @return couponIdCondition 会员优惠券ID查询条件
	 */
	public Condition<String> getCouponIdCondition() {
		return couponIdCondition;
	}

	/**
	 * 设置会员优惠券ID查询条件
	 * 
	 * @param couponIdCondition 会员优惠券ID查询条件
	 */
	public void setCouponIdCondition(Condition<String> couponIdCondition) {
		this.couponIdCondition = couponIdCondition;
	}

	/**
	 * 构造并返回优惠券名称查询条件
	 * 
	 * @return couponNameCondition 优惠券名称查询条件
	 */
	public Condition<String> couponName() {
		this.couponNameCondition = new Condition<>();
		return this.couponNameCondition;
	}
	
	/**
	 * 获取优惠券名称查询条件
	 * 
	 * @return couponNameCondition 优惠券名称查询条件
	 */
	public Condition<String> getCouponNameCondition() {
		return couponNameCondition;
	}

	/**
	 * 设置优惠券名称查询条件
	 * 
	 * @param couponNameCondition 优惠券名称查询条件
	 */
	public void setCouponNameCondition(Condition<String> couponNameCondition) {
		this.couponNameCondition = couponNameCondition;
	}

	/**
	 * 构造并返回优惠券模板ID(冗余ID)查询条件
	 * 
	 * @return couponTemplateIdCondition 优惠券模板ID(冗余ID)查询条件
	 */
	public Condition<String> couponTemplateId() {
		this.couponTemplateIdCondition = new Condition<>();
		return this.couponTemplateIdCondition;
	}
	
	/**
	 * 获取优惠券模板ID(冗余ID)查询条件
	 * 
	 * @return couponTemplateIdCondition 优惠券模板ID(冗余ID)查询条件
	 */
	public Condition<String> getCouponTemplateIdCondition() {
		return couponTemplateIdCondition;
	}

	/**
	 * 设置优惠券模板ID(冗余ID)查询条件
	 * 
	 * @param couponTemplateIdCondition 优惠券模板ID(冗余ID)查询条件
	 */
	public void setCouponTemplateIdCondition(Condition<String> couponTemplateIdCondition) {
		this.couponTemplateIdCondition = couponTemplateIdCondition;
	}

}
